package xyz.xtt.pay.enums;

public enum PayOrderRefundStatusEnum {
    /**
     * 待退款
     */
    NEED_REFUND(0),
    /**
     * 退款中
     */
    REFUNDING(1),
    /**
     * 退款成功
     */
    REFUNDED(2),
    /**
     * 退款失败
     */
    REFUND_FAIL(3);

    private int code;

    PayOrderRefundStatusEnum(int code) {
        this.code = code;
    }

    public int getCode() {
        return code;
    }

    public static PayOrderRefundStatusEnum getByCode(int code) {
        for (PayOrderRefundStatusEnum value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }
}
